home *** CD-ROM | disk | FTP | other *** search
- >>>>> Joe Buck <jbuck@Synopsys.COM> writes:
-
- > Stroustrup proposes that operator. only forward to the resulting class
- > for a.m if the object itself doesn't have a member m. I dislike that
- > approach; it is unnecessary since (&a)->m accesses it, and since
- > the class is going to present itself as a disguised reference object
- > in any case, only private code is going to mess around with the object's
- > own members. In member functions, one would merely write "m".
-
- I think a more natural way to achieve the delegation semantics proposed by
- Stroustrup would be to extend 'using' along these lines:
-
- struct A {
- void f ();
- };
-
- struct ARef {
- A* a;
- using *a;
- };
-
- main ()
- {
- ARef ar = { new A };
- ar.f (); // (*(ar.a)).f();
- }
-
- Of course, that's not likely to happen either.
-
- Jason
-
- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
- Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
- is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
-
-